about dialog: differentiate GPL "or later" versions
authorWilliam Jon McCann <william.jon.mccann@gmail.com>
Mon, 16 Dec 2013 16:06:24 +0000 (11:06 -0500)
committerWilliam Jon McCann <william.jon.mccann@gmail.com>
Mon, 16 Dec 2013 16:44:35 +0000 (11:44 -0500)
https://bugzilla.gnome.org/show_bug.cgi?id=720410

gtk/gtkaboutdialog.c
gtk/gtkaboutdialog.h

index 1e5536df712c86c82b947b98fa163e4289719304..a694a191ec1dd9b00dc8e1cf7433c7c7a0c8b6e0 100644 (file)
  */
 
 /* Translators: this is the license preamble; the string at the end
- * contains the URL of the license.
+ * contains the name of the license as link text.
  */
-static const gchar *gtk_license_preamble = N_("This program comes with ABSOLUTELY NO WARRANTY;\nfor details, visit <a href=\"%s\">%s</a>");
+static const gchar *gtk_license_preamble = N_("This program comes with ABSOLUTELY NO WARRANTY.\nSee the <a href=\"%s\">%s</a> for details.");
 
-/* URLs for each GtkLicense type; keep in the same order as the enumeration */
-static const gchar *gtk_license_urls[] = {
-  NULL,
-  NULL,
-
-  "http://www.gnu.org/licenses/old-licenses/gpl-2.0.html",
-  "http://www.gnu.org/licenses/gpl.html",
-
-  "http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html",
-  "http://www.gnu.org/licenses/lgpl.html",
-
-  "http://opensource.org/licenses/bsd-license.php",
-  "http://opensource.org/licenses/mit-license.php",
-
-  "http://opensource.org/licenses/artistic-license-2.0.php"
+typedef struct
+{
+  const gchar *name;
+  const gchar *url;
+} LicenseInfo;
+
+/* LicenseInfo for each GtkLicense type; keep in the same order as the enumeration */
+static const LicenseInfo gtk_license_info [] = {
+  { N_("License"), NULL },
+  { N_("Custom License") , NULL },
+  { N_("GNU General Public License, version 2 or later"), "http://www.gnu.org/licenses/old-licenses/gpl-2.0.html" },
+  { N_("GNU General Public License, version 3 or later"), "http://www.gnu.org/licenses/gpl.html" },
+  { N_("GNU Lesser General Public License, version 2.1 or later"), "http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html" },
+  { N_("GNU Lesser General Public License, version 3 or later"), "http://www.gnu.org/licenses/lgpl.html" },
+  { N_("BSD 2-Clause License"), "http://opensource.org/licenses/bsd-license.php" },
+  { N_("The MIT License (MIT)"), "http://opensource.org/licenses/mit-license.php" },
+  { N_("Artistic License 2.0"), "http://opensource.org/licenses/artistic-license-2.0.php" },
+  { N_("GNU General Public License, version 2 only"), "http://www.gnu.org/licenses/old-licenses/gpl-2.0.html" },
+  { N_("GNU General Public License, version 3 only"), "http://www.gnu.org/licenses/gpl.html" },
+  { N_("GNU Lesser General Public License, version 2.1 only"), "http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html" },
+  { N_("GNU Lesser General Public License, version 3 only"), "http://www.gnu.org/licenses/lgpl.html" }
 };
 
 typedef struct
@@ -2479,16 +2485,18 @@ gtk_about_dialog_set_license_type (GtkAboutDialog *about,
       /* custom licenses use the contents of the :license property */
       if (priv->license_type != GTK_LICENSE_CUSTOM)
         {
+          const gchar *name;
           const gchar *url;
           gchar *license_string;
           GString *str;
 
-          url = gtk_license_urls[priv->license_type];
+          name = _(gtk_license_info[priv->license_type].name);
+          url = gtk_license_info[priv->license_type].url;
           if (url == NULL)
             url = priv->website_url;
 
           str = g_string_sized_new (256);
-          g_string_append_printf (str, _(gtk_license_preamble), url, url);
+          g_string_append_printf (str, _(gtk_license_preamble), url, name);
 
           g_free (priv->license);
           priv->license = g_string_free (str, FALSE);
index 61cf6b68d32d3c3f5adb011ba25ffcb54fd08b3e..302e763e0ba07e6dbc3f55473a2fa169d0fef94e 100644 (file)
@@ -74,7 +74,12 @@ typedef enum {
   GTK_LICENSE_BSD,
   GTK_LICENSE_MIT_X11,
 
-  GTK_LICENSE_ARTISTIC
+  GTK_LICENSE_ARTISTIC,
+
+  GTK_LICENSE_GPL_2_0_ONLY,
+  GTK_LICENSE_GPL_3_0_ONLY,
+  GTK_LICENSE_LGPL_2_1_ONLY,
+  GTK_LICENSE_LGPL_3_0_ONLY
 } GtkLicense;
 
 /**